<?php

$str = "189251ad3s919ad4s";

$preg = "/[a-z][a-z]\d[a-z]/";

$c = preg_match($preg,$str);

// var_dump($c);


$str = "学并思官网www.xuebingsiwang.com学并思论坛http://bbs.xuebingsiwang.com我在学并思的网名叫xuebingsi";

$preg = "/(xue)bingsi(wang)/";

$temp = preg_replace($preg,'$1xxxx$2',$str);

// var_dump($temp);


$str = "http://www.baidu.com不新浪网http://www.sina.com,ttp://www.163.com,,,,ttp://www.qq.com";

$preg = "/(\.)(baidu|sina|163|qq)(\.)/";


$new_str = preg_replace($preg,'$1xuebing$2siwang$3',$str);

// var_dump($new_str);

$num = "12"; // 01 02 03 04 05 06 07 08 09 10 11 12

$preg  = "/(0[1-9]|1[0-2])/"; 
$preg  = "/(0[1-9]|[12]\d|3[0-1])/";

$img = "dfg.jpgdfg";

$preg ="/(\.jpg|\.png|\.gif)$/";

$name = "明明";

$preg = "/^明/";


$c = preg_match($preg,$name);



$num = "11025139194";

$preg = "/^1(3\d|4[47]|5[01536879]|66|7\d|8\d|90)\d{8}$/";


// /^1(3|4|5|7|8)\d{9}$/

// ^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|166|198|199|(147))\d{8}$

$c = preg_match($preg,$num);

var_dump($c);

// /^1([38]\d|5[0-35-9]|7[3678])\d{8}$/;
// 

$username = "_xue89089"; 
// 不能数字开头，长度6-8，数字字母下划线。

// $perg = "/^[z-a_]\w{5,7}$/s";


// $c = preg_match($perg,$username);

// var_dump($c);




// $num = "3423432486";

// $preg = "/^\d{6,8}$/";
// 

$str = "<span>学并思
</span><p>学并思</p><span>学并思1</span>";


$preg = "/<span>.+?<\/span>/s";


$str = preg_replace($preg,'xxxx',$str);


var_dump($str);
// 


$str = "lkjhlkj545345dfjgldfkg";

$preg = "/\d{3,6}?/";

$str = preg_replace($preg,'xxx',$str);

// var_dump($str);


// preg_match();

// preg_replace();

$str = "sdf,sdf,sdf.sdf,sdf,s.sdf,s.ff,sdf_sdf,sdfsdf";

$preg = "/(\.|,|_)/";

$arr =preg_split($preg,$str);

var_dump($arr);


preg_match_all();




preg_match()
preg_match_all()
preg_replace()
preg_split();

1 邮箱正则

2 身份证正则

3  https://www.lagou.com/ 所有分类提取出来

4 职位详情页面，提取职位名，工资，城市 ，公司，详情


